//
//  SYImageTableViewCell.m
//  TermOfSectionB
//
//  Created by dllo on 15/11/28.
//  Copyright © 2015年 韩震明. All rights reserved.
//

#import "SYImageTableViewCell.h"

#define SWIDTH [UIScreen mainScreen].bounds.size.width / 375.0
#define SHEIGHT [UIScreen mainScreen].bounds.size.height / 667.0

@implementation SYImageTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    
    self.contImage = [[UIImageView alloc] init];
    self.contImage.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.contImage];
  
}
- (void)layoutSubviews {
    [super layoutSubviews];
    
    
    UIImage *image = self.contImage.image;
    
    
    if (image.size.width != 0) {
        
        self.contImage.frame = CGRectMake(0, 0, (self.contentView.frame.size.width), image.size.height * (SWIDTH * [UIScreen mainScreen].bounds.size.width) / image.size.width);
    }
}

- (void)awakeFromNib {
    // Initialization code
    
    
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
